<?php

/**
 * @Author: king
 * @Date:   2019-05-04 17:02:43
 * @Last Modified by:   king
 * @Last Modified time: 2019-05-30 15:36:18
 */
namespace App\Models\Api;
use App\Exceptions\ApiException;
use App\Models\Api\Base;
use Cache;

class LanmeiCounselorInform extends Base
{
   protected $table = 'counselor_inform';


    /**
     * @param $caId
     * @return array|null
     * @throws ApiException
     * @throws \Exception
     */
    public static function getInformInfo($caId)
    {
        try
        {
            $info = self::where('ca_id', $caId)->select('tid','content','status')->first();

            if (!$info)
            {
                return null;
            }

            $tagData = LanmeiTag::getTagData(3);

        }
        catch (Exception $e)
        {
            throw new ApiException('服务异常', 200, config('code.error'));
        }

        return [
            'type_name' => $tagData[$info['tid']],
            'content' => $info['content'],
            'status' => $info['status']
        ];
    }

}
